<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script type="text/javascript" src="./js/vue.js"></script>
</head>
<body>
    <div id="app">
        <div class="rect" v-on:click="alertRed">
            <div class="blue" @click="alertBlue">我是蓝色的区域</div>
            <div class="yellow" @click.stop="alertYellow">我是黄色的区域</div>
        </div>
    </div>
    <script>
        //.stop修饰符
        const vm=new Vue({
            el:"#app",
            data:{},
            methods: {
                alertBlue:function(){
                    console.log("blue");
                },
                alertYellow:function(){
                    console.log("yellow");
                },
                alertRed(){
                    console.log("red");
                }
            }
        })
    </script>
</body>
<style>
    .rect{display: flex;width: 400px;height: 200px;background-color: #e45757;}
    .blue{width: 100px;height: 100px;background: blue;}
    .yellow{width: 100px;height: 100px;background: yellow;}
</style>
</html>